package com.bsoft.gol.hcs.specialist.dao;

import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import ctd.persistence.support.hibernate.HibernateSupportDelegateDAO;
import com.bsoft.gol.hcs.specialist.entity.FollowUpRouteDetailForm;

import java.util.List;

/**
 * @Author: lanyu
 * @Description: 随访路径详情表单关联表
 * @Date: create in 2022/5/16 16:28
 */
public abstract class FollowUpRouteDetailFormDAO extends HibernateSupportDelegateDAO<FollowUpRouteDetailForm> {

    /**
     * 根据主路径和类型获取表单信息
     *
     */
    @DAOMethod(sql = " from FollowUpRouteDetailForm where route_id =:routeId and item_type=:itemType")
    public abstract List<FollowUpRouteDetailForm> queryByRouteId(@DAOParam("routeId") Long routeId, @DAOParam("itemType") Byte itemType);

    /**
     * 根据路径详情获取表单信息
     *
     * @param routeDetailId
     * @return
     */
    @DAOMethod(sql = " from FollowUpRouteDetailForm where route_detail_id =:routeDetailId ")
    public abstract List<FollowUpRouteDetailForm> queryByRouteDetailId(@DAOParam("routeDetailId") Long routeDetailId);

    /**
     * 根据路径详情id和类型查询推荐科室
     *
     * @param routeDetailId
     * @param itemType
     * @return
     */
    @DAOMethod(sql = " from FollowUpRouteDetailForm where route_detail_id =:routeDetailId and item_type=:itemType ")
    public abstract List<FollowUpRouteDetailForm> queryRecommendFactorList(@DAOParam("routeDetailId") Long routeDetailId, @DAOParam("itemType") Byte itemType);

    /**
     * 根据路径详情id删除信息
     *
     * @param routeDetailId
     */
    @DAOMethod(sql = "delete from FollowUpRouteDetailForm where route_detail_id =:routeDetailId")
    public abstract void deleteFollowUpDetailFormByRouteDetailId(@DAOParam("routeDetailId") Long routeDetailId);

}
